let mysql = require("mysql");

let con = mysql.createConnection({
    host: "localhost",
    user: "DUN",
    password: "20180261",
    database: "YSLshopping",
});

con.connect();

module.exports = {
    query(sql) {
        return new Promise((resolve, reject) => {
            con.query(sql, (err, data) => {
                if (err) {
                    reject(err)
                    return
                }
                resolve(data);
            });
        });
    },
};
